<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0,viewport-fit=cover">
	<title>自助开票历史</title>
	<link rel="stylesheet" href="__TEMP__/{$style}/public/wxdist/style/weui.css">
	<link rel="stylesheet" href="__TEMP__/{$style}/public/wxdist/example/example.css">
	<style>
		* {
			font-size: 14px;
			color: #565656;
		}

		.title-div {
			height: 45px;
			line-height: 45px;
			text-align: center;
			background: #FFFFFF;
			border-bottom: 1px solid #dedede;
		}

		.title-div p {
			line-height: 45px;
			font-size: 18px;

		}

		.lt {
			float: left;
		}

		.ft {
			float: right;
		}

		.cl {
			clear: both;
		}

		.min-sh {
			font-size: 12px;
			color: #AAAAAA;
		}

		.weui-article p {
			font-size: 12px;
			color: #999999;
		}

		.weui-form-preview {
			margin-bottom: 10px;
		}
		.weui-form-preview__value{
			font-size: 16px!important;
		}
	</style>
</head>
<body>
<!--<div class="title-div">
	<p>自助开票</p>
</div>-->
<div class="page preview js_show">
	<div class="weui-cells__title">自助开票历史</div>
	<div class="page__bd">
		{if condition="$list neq null"}
		{foreach name="list" item = "vo" key = "key"}
		<div class="weui-form-preview">
			<div class="weui-form-preview__hd">
				<div class="weui-form-preview__item">
					<label class="weui-form-preview__label">发票抬头</label>
					<em class="weui-form-preview__value">{$vo.fp_tt_name}</em>
				</div>
			</div>
			<div class="weui-form-preview__bd">
				<div class="weui-form-preview__item">
					<label class="weui-form-preview__label">税号</label>
					<span class="weui-form-preview__value">{$vo.duty}</span>
				</div>
				<div class="weui-form-preview__item">
					<label class="weui-form-preview__label">入住酒店</label>
					<span class="weui-form-preview__value">{$vo.check_in_hotel}</span>
				</div>
				<div class="weui-form-preview__item">
					<label class="weui-form-preview__label">备注</label>
					<span class="weui-form-preview__value">{$vo.remark}</span>
				</div>
			</div>
		</div>
		{/foreach}
		{else /}
		<div class="weui-footer" style="margin-top: 30px">
			<p class="weui-footer__text">暂无开票信息...</p>
		</div>
		{/if}
		<!--<div class="weui-form-preview">
			<div class="weui-form-preview__hd">
				<label class="weui-form-preview__label">付款金额</label>
				<em class="weui-form-preview__value">¥2400.00</em>
			</div>
			<div class="weui-form-preview__bd">
				<div class="weui-form-preview__item">
					<label class="weui-form-preview__label">商品</label>
					<span class="weui-form-preview__value">电动打蛋机</span>
				</div>
				<div class="weui-form-preview__item">
					<label class="weui-form-preview__label">标题标题</label>
					<span class="weui-form-preview__value">名字名字名字</span>
				</div>
				<div class="weui-form-preview__item">
					<label class="weui-form-preview__label">标题标题</label>
					<span class="weui-form-preview__value">很长很长的名字很长很长的名字很长很长的名字很长很长的名字很长很长的名字</span>
				</div>
			</div>
			<div class="weui-form-preview__ft">
				<a class="weui-form-preview__btn weui-form-preview__btn_default" href="javascript:">辅助操作</a>
				<button type="submit" class="weui-form-preview__btn weui-form-preview__btn_primary" href="javascript:">操作</button>
			</div>
		</div>-->
	</div>
</div>
<script src="__TEMP__/{$style}/public/wxdist/example/zepto.min.js"></script>
<!--<script src="__TEMP__/{$style}/public/js/vconsole.min.js"></script>-->
<script type="text/javascript" src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script src="https://res.wx.qq.com/open/libs/weuijs/1.0.0/weui.min.js"></script>
<script>


	window.onload = function () {
		// 初始化
		// var vConsole = new VConsole();
		$("#select_invoice").click(function () {
			wx.invoke('chooseInvoiceTitle', {
				// 这里要传入参数
				"scene": "1"
			}, function (res) {
				// 这里处理调用结果
				if (res.err_msg == 'chooseInvoiceTitle:ok') {
					var type = res.choose_invoice_title_info;
					var titleInfo = JSON.parse(type);
					// console.log(titleInfo);
					var htmlStr = '';
					// 0单位，1个人
					var invoiceTitle = titleInfo.title;
					if (titleInfo.type == '0') {
						var Tariff = titleInfo.taxNumber;
						htmlStr = '<p>' + invoiceTitle + '</p><p class="min-sh">税号：' + Tariff + '</p>';
					} else {
						htmlStr += '<p>' + invoiceTitle + '</p>';
					}
					$("#invoiceInfo").val(type);

					$("#sel_invoice_res").html(htmlStr);
				} else if (res.err_msg == 'chooseInvoiceTitle:cancel') {
					weui.topTips('本次操作没有选择发票抬头', 3000);
				} else {
					// console.log(res);
					$('#iosDialog2>.weui-dialog>.weui-dialog__bd').text('获取微信发票抬头出错了，请稍后重试或至前台酒店前台办理发票');
					$('#iosDialog2').fadeIn(200);
					// alert(1);
				}
			});
		});


		$('#iosDialog2').on('click', '.weui-dialog__btn', function () {
			$(this).parents('.js_dialog').fadeOut(200);
		});

	}


</script>
</body>
</html>